package com.example.demo.task;

import com.example.demo.bean.Account;
import com.example.demo.bean.Order;
import com.example.demo.enums.OrderEnum;
import com.example.demo.service.AccountService;
import com.example.demo.service.OrderService;
import com.example.demo.service.impl.MQServiceImpl;
import com.github.phantomthief.util.ThrowableRunnable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

public class TransferTask implements ThrowableRunnable<Exception> {

    private Account merchant;

    private String orderId;
    private Double money;


    private boolean flag;

    public TransferTask(Account merchant,Double money,String orderId,boolean flag){
        this.merchant = merchant;
        this.money = money;
        this.orderId = orderId;
        this.flag = flag;
    }

    Transfer transfer = new Transfer(merchant,orderId,money,flag);

    @Override
    public void run() {
        transfer.transfer();
    }
}
